package shili;

import java.util.logging.Logger;

/**
 * AroundLogger
 *
 * @author boy
 * @since 2023/10/16
 */
@Aspect
public class AroundLogger {
    private static final Logger log=Logger.getLogger(String.valueOf(AroundLogger.class));
   @Around("execution(* service.UserService.*(..))")
    public Object aroundLogger(ProceedingJoinPoint jp) throws Throwable{
        log.info("调用"+jp.getTarget()+"");
        try{
            Object result=jp.proceed();
            log.info("调用"+jp.getTarget()+"");
            return result;
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            log.info(jp.getSignattrue().getName());
        }
        return null;
    }
}
